﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mwc="clr-namespace:Mongoose.Windows.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Mongoose.Windows;component/Themes/Shared.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="PadDefaultStyle" TargetType="{x:Type mwc:Pad}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="MinWidth" Value="80" />
        <Setter Property="MinHeight" Value="40" />
        <Setter Property="DisplayName" Value="Pad" />
    </Style>

    <ControlTemplate x:Key="PadDefaultTemplate" TargetType="{x:Type mwc:Pad}">
        <Grid Background="White" Style="{x:Null}" FocusVisualStyle="{x:Null}">
            
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" Style="{x:Null}" FocusVisualStyle="{x:Null}" />
                <RowDefinition Height="Auto" Style="{x:Null}" FocusVisualStyle="{x:Null}" />
                <RowDefinition Height="*" Style="{x:Null}" FocusVisualStyle="{x:Null}" />
                <RowDefinition Height="Auto" Style="{x:Null}" FocusVisualStyle="{x:Null}" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" Style="{x:Null}" FocusVisualStyle="{x:Null}" />
                <ColumnDefinition Width="*" Style="{x:Null}" FocusVisualStyle="{x:Null}" />
                <ColumnDefinition Width="Auto" Style="{x:Null}" FocusVisualStyle="{x:Null}" />
            </Grid.ColumnDefinitions>

            <!-- Empty control for  shadow effet -->
            <Border Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Grid.ColumnSpan="3" 
                    BorderThickness="0" 
                    Background="Black" 
                    BorderBrush="Transparent" 
                    Style="{x:Null}" FocusVisualStyle="{x:Null}">
                <Border.Effect>
                    <DropShadowEffect Color="Black" ShadowDepth="1" />
                </Border.Effect>
            </Border>

            <!-- Pad bar template -->
            <mwc:PadControlBar x:Name="PART_ControlBar" 
                              Grid.Row ="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="3"
                              Foreground="{StaticResource SubColor}" 
                              Background="{StaticResource InactiveDominantBrush}"/>

            <!-- Content template -->
            <Border Grid.Row="2" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="3"
                    x:Name="PadBorder"
                    BorderBrush="{StaticResource InactiveDominantBrush}"
                    Background="White"
                    BorderThickness="1,0,1,1"
                    Style="{x:Null}" FocusVisualStyle="{x:Null}">
                <ContentPresenter Content="{TemplateBinding Content}" 
                                  ContentTemplate="{TemplateBinding ContentTemplate}" 
                                  ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                  Style="{x:Null}" FocusVisualStyle="{x:Null}" />
            </Border>

            <!-- Pad Left Resizer -->
            <mwc:PadResizer Grid.Row="1" Grid.Column="0" Grid.RowSpan="2"
                            Width="10"
                            Position="Left">
                <mwc:PadResizer.RenderTransform>
                    <TranslateTransform X="-5" />
                </mwc:PadResizer.RenderTransform>
            </mwc:PadResizer>

            <!-- Pad Top Resizer -->
            <mwc:PadResizer Grid.Row="0" Grid.Column="1"
                            Height="10"
                            Position="Top">
                <mwc:PadResizer.RenderTransform>
                    <TranslateTransform Y="-10" />
                </mwc:PadResizer.RenderTransform>
            </mwc:PadResizer>

            <!-- Pad Right Resizer -->
            <mwc:PadResizer Grid.Row="1" Grid.Column="2" Grid.RowSpan="2"
                           Width="10"
                           Position="Right">
                <mwc:PadResizer.RenderTransform>
                    <TranslateTransform X="5" />
                </mwc:PadResizer.RenderTransform>
            </mwc:PadResizer>

            <!-- Pad Bottom Resizer -->
            <mwc:PadResizer Grid.Row="3" Grid.Column="1"
                           Height="10"
                           Position="Bottom">
                <mwc:PadResizer.RenderTransform>
                    <TranslateTransform Y="5" />
                </mwc:PadResizer.RenderTransform>
            </mwc:PadResizer>

            <!-- Pad TopLeft Resizer -->
            <mwc:PadResizer Grid.Row="0" Grid.Column="0"
                            Width="10" Height="10"
                            Position="TopLeft">
                <mwc:PadResizer.RenderTransform>
                    <TranslateTransform X="-5"  Y="-10" />
                </mwc:PadResizer.RenderTransform>
            </mwc:PadResizer>

            <!-- Pad TopRight Resizer -->
            <mwc:PadResizer Grid.Row="0" Grid.Column="2"
                            Width="10" Height="10"
                            Position="TopRight">
                <mwc:PadResizer.RenderTransform>
                    <TranslateTransform X="5"  Y="-10" />
                </mwc:PadResizer.RenderTransform>
            </mwc:PadResizer>

            <!-- Pad BottomLeft Resizer -->
            <mwc:PadResizer Grid.Row="3" Grid.Column="0"
                            Width="10" Height="10"
                            Position="BottomLeft">
                <mwc:PadResizer.RenderTransform>
                    <TranslateTransform X="-5"  Y="5" />
                </mwc:PadResizer.RenderTransform>
            </mwc:PadResizer>
            
            <!-- Pad BottomRight Resizer -->
            <mwc:PadResizer Grid.Row="3" Grid.Column="2"
                            Width="10" Height="10"
                            Position="BottomRight">
                <mwc:PadResizer.RenderTransform>
                    <TranslateTransform X="5"  Y="5" />
                </mwc:PadResizer.RenderTransform>
            </mwc:PadResizer>

        </Grid>

        <ControlTemplate.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter TargetName="PART_ControlBar" Property="Background" Value="{StaticResource ActiveDominantBrush}" />
                <Setter TargetName="PadBorder" Property="BorderBrush" Value="{StaticResource ActiveDominantBrush}" />
            </Trigger>
        </ControlTemplate.Triggers>

    </ControlTemplate>

</ResourceDictionary>